<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:p="http://primefaces.prime.com.tr/ui"
      > 

    <h:head> 
        <title>Delete Area From Show</title> 

        <style type="text/css"> 

            .gritter-notice-wrapper { 
                left:200px; 
                top:50px; 
            }
            
        </style> 

    </h:head> 
    <h:body>
        <h1>Stakeholder Event Area Management</h1>
        <h:outputText value="Welcome, #{stakeholderEventMB.stakeholderName}"/>
        <h:inputHidden value="#{stakeholderEventMB.stakeholderId}"/>
        <h:form>
            <h:commandLink value="Home" action="index.xhtml?faces-redirect=true"/>
            <br/>
            <h:commandLink id="back" value="Back" onclick="if (!confirm('Are you sure you want to go back?')) return false"
                                         action="addevent.xhtml?faces-redirect=true" />
        </h:form>
        <p:layout style="table-layout:auto; height:700px ">
            <p:layoutUnit position="left" header="Navigation" width="300">
                <h:form id="EventTCube">
                    <h:commandLink value="Add Event" action="addevent.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Delete Event" action="deleteevent.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Modify Event" action="modifyevent.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Add Show" action="addshow.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Delete Show" action="deleteshow.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Modify Show" action="modifyshow.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Add Poster" action="addposter.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Delete Poster" action="deleteposter.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Change Poster" action="modifyposter.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Add Area" action="addarea.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Delete Area" action="addarea.xhtml?faces-redirect=true"/>
                    <br/>
                    <h:commandLink value="Modify area" action="modifyarea.xhtml?faces-redirect=true"/>
                    <br/>
                </h:form>
            </p:layoutUnit>
            <p:layoutUnit position="center" header="Select Area From Event To Modify Area" scrollable="true">
                <h:form id="showUpdateForm">
                    <p:ajaxStatus style="width:16px;height:16px;">
                        <f:facet name="start">
                            <h:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" />
                        </f:facet>
                        <f:facet name="complete">
                            <h:outputText value="" />
                        </f:facet>
                    </p:ajaxStatus>
                    <p:messages />
                    
                    <p:panel id="panel" >
                        <h:panelGrid columns="2" border="0">
                            <p:dataTable value="#{stakeholderPerformanceMB.getAllAreas()}" var="areas">
                                
                                <p:column>
                                    <f:facet name="header">Area ID</f:facet>
                                    <h:outputText id="areaId" value="#{areas.id}" />
                                </p:column>

                                <p:column>
                                    <f:facet name="header">Area Name</f:facet>         
                                    <h:outputText id="areaName" value="#{areas.areaName}" />
                                </p:column>
                                
                                <p:column>
                                    <f:facet name="header">Cost</f:facet>
                                    <h:outputText id="cost" value="#{areas.cost}" />
                                </p:column>
                                
                                <p:column>
                                    <f:facet name="header">Capacity</f:facet>
                                    <h:outputText id="capacity" value="#{areas.capacity}" />
                                </p:column>
                                
                                <p:column>
                                    <f:facet name="header">Action</f:facet>
                                    <h:commandLink  value="Modify" 
                                                    onclick="if (!confirm('Are you sure you want to modify area ##{areas.id}(#{areas.areaName})?')) return false"
                                                    action="modifyselectedarea.xhtml?faces-redirect=true">
                                        <f:setPropertyActionListener target="#{stakeholderPerformanceMB.areaId}" value="#{areas.id}"/>
                                        <f:setPropertyActionListener target="#{stakeholderPerformanceMB.areaName}" value="#{areas.areaName}"/>
                                        <f:setPropertyActionListener target="#{stakeholderPerformanceMB.cost}" value="#{areas.cost}"/>
                                    </h:commandLink>
                                </p:column>
                            </p:dataTable> 
                        </h:panelGrid>
                        <hr/>
                    </p:panel>
                    
                </h:form>
                <br/>
                
            </p:layoutUnit>
        </p:layout>
    </h:body> 
</html>

